package com.qxy.alibaba;

import lombok.Data;

import java.math.BigDecimal;

/**
 * @author : 戚欣扬
 * @Description :
 */
@Data
public class BigDecimalPractise {
    Integer code ;
    public static void main(String[] args) {
        BigDecimal num1 = new BigDecimal("0.03");
        BigDecimal num2 = new BigDecimal("0.02");
        System.out.println(num1.subtract(num2));
        System.out.println("=========================");

        BigDecimal num3 = BigDecimal.valueOf(0.03);
        BigDecimal num4 = BigDecimal.valueOf(0.02);
        System.out.println(num3.subtract(num4));
        System.out.println("=========================");

        Double d1 = 0.03;
        Double d2 = 0.02;
        BigDecimal bigDecimal = new BigDecimal(d1.toString());
        BigDecimal bigDecimal1 = new BigDecimal(d2.toString());
        System.out.println(bigDecimal.subtract(bigDecimal1));
        System.out.println("=========================");

        BigDecimalPractise bigDecimalPractise = new BigDecimalPractise();
        bigDecimalPractise.setCode(200);
        System.out.println(bigDecimalPractise.getCode()==200);
        System.out.println("=========================");

    }
}


